export function airlineFormat(info, EntityType = 'applyline') {
  let arr1 = info.airlinePoints.split(",");
  let arr2 = arr1.map((item) => {
    return item.split("@");
  });
  let position = arr2.map((item) => {
    let lon = item[0] * 1;
    let lat = item[1] * 1;
    return [lon, lat, item[2] * 1];
  });
  let len = position.length;
  let centerPoint = len % 2 ? position[(len - 1) / 2] : position[len / 2];

  let standbyPosition = null;
  let standbyPoint = null;
  if (info.alternateLandingPointLatitude) {
    if (info.alternateLandingPointConnection) {
      let point = info.alternateLandingPointConnection.split(",");
      standbyPosition = [
        [
          info.alternateLandingPointLongitude * 1,
          info.alternateLandingPointLatitude * 1,
          0,
        ],
        [point[0] * 1, point[1] * 1, point[2] * 1],
      ];
    } else {
      standbyPosition = [
        [
          info.alternateLandingPointLongitude * 1,
          info.alternateLandingPointLatitude * 1,
          0,
        ],
        position[len - 2],
      ];
    }

    standbyPoint = [
      info.alternateLandingPointLongitude * 1,
      info.alternateLandingPointLatitude * 1,
      0,
    ];
  }
  let data = {
    ...info,
    EntityType,
    speed: 3000,
    position,
    centerPoint,
    zoom: 13,
    id: info.airspaceApplyId,
    applyTime: info.updateTime,
    takeOffAddress: info.takeOffPointAddress,
    landingAddress: info.landingPointAddress,
    ALTNAddress: info.alternateLandingPointAddress,
    color: info.aircraftType === 4 ? "#00ffd2" : "#fcff00",
    takeoffPoint: position[0],
    iconS: import.meta.env.VITE_BASE_PUBLICPATH + "/img/cockpit/startPoint.png",
    landingPoint: position[len - 1],
    iconE: import.meta.env.VITE_BASE_PUBLICPATH + "/img/cockpit/endPoint.png",
    standbyPosition,
    standbyPoint,
    iconB: import.meta.env.VITE_BASE_PUBLICPATH + "/img/cockpit/standbyPoint.png",
  };
  return data
}